home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Tk_DoWhenIdle(3) Tk Library Procedures
-
-
-
- _________________________________________________________________
-
- NAME
- Tk_DoWhenIdle, Tk_CancelIdleCall - invoke a procedure when
- there are no pending events
-
- SYNOPSIS
- #include <tk.h>
-
- Tk_DoWhenIdle(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
-
- Tk_CancelIdleCall(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a) |
-
- ARGUMENTS
- Tk_IdleProc *_p_r_o_c (in) Procedure to invoke.
-
- ClientData _c_l_i_e_n_t_D_a_t_a (in) Arbitrary one-word
- value to pass to _p_r_o_c.
- _________________________________________________________________
-
-
- DESCRIPTION
- Tk_DoWhenIdle arranges for _p_r_o_c to be invoked when the
- application becomes idle. The application is considered to
- be idle when Tk_DoOneEvent has been called, it couldn't find
- any events to handle, and it is about to go to sleep waiting
- for an event to occur. At this point all pending
- Tk_DoWhenIdle handlers are invoked. For each call to
- Tk_DoWhenIdle there will be a single call to _p_r_o_c; after
- _p_r_o_c is invoked the handler is automatically removed.
- Tk_DoWhenIdle is only useable in programs that use
- Tk_DoOneEvent to dispatch events.
-
- _P_r_o_c should have arguments and result that match the type
- Tk_IdleProc:
- typedef void Tk_IdleProc(ClientData _c_l_i_e_n_t_D_a_t_a);
- The _c_l_i_e_n_t_D_a_t_a parameter to _p_r_o_c is a copy of the _c_l_i_e_n_t_D_a_t_a
- argument given to Tk_DoWhenIdle. Typically, _c_l_i_e_n_t_D_a_t_a
- points to a data structure containing application-specific
- information about what _p_r_o_c should do.
-
- Tk_CancelIdleCall may be used to cancel one or more previous |
- calls to Tk_DoWhenIdle: if there is a Tk_DoWhenIdle handler |
- registered for _p_r_o_c and _c_l_i_e_n_t_D_a_t_a, then it is removed |
- without invoking it. If there is more than one handler on |
- the idle list that refers to _p_r_o_c and _c_l_i_e_n_t_D_a_t_a, all of the |
- handlers are removed. If no existing handlers match _p_r_o_c |
- and _c_l_i_e_n_t_D_a_t_a then nothing happens.
-
- Tk_DoWhenIdle is most useful in situations where (a) a piece
- of work will have to be done but (b) it's possible that
- something will happen in the near future that will change
-
-
-
- Tk 1
-
-
-
-
-
-
- Tk_DoWhenIdle(3) Tk Library Procedures
-
-
-
- what has to be done, or require something different to be
- done. Tk_DoWhenIdle allows the actual work to be deferred
- until all pending events have been processed. At this point
- the exact work to be done will presumably be known and it
- can be done exactly once.
-
- For example, Tk_DoWhenIdle might be used by an editor to
- defer display updates until all pending commands have been
- processed. Without this feature, redundant redisplays might
- occur in some situations, such as the processing of a com-
- mand file.
-
-
- KEYWORDS
- callback, defer, handler, idle
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tk 2
-
-
-
-